<template>
	<view class="layOut">
		<view class="navbar">
			<view class="statusBar" :style="{height:getStatusBarHeight()+'px'}"></view>
			<view class="titleBar" :style="{height:getTitleBarHeight()+'px',marginLeft:getLeftIconLeft() + 'px'}">
				<view class="title">
					{{title}}
				</view>
				<navigator class="search" url="/pages/search/search" open-type="reLaunch">
					<uni-icons class="icon" type="search" color="#888" size="18"></uni-icons>
					<text class="text">搜索</text>
				</navigator>
			</view>
		</view>
		
		<!-- 位置填充元素 -->
		<view class="fill" :style="{height:getNavBarHeight()+'px'}"></view>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import {getStatusBarHeight,getTitleBarHeight,getNavBarHeight,getLeftIconLeft} from "@/utils/system.js";
	defineProps({
		title:{
			tytpe:String,
			default:"壁纸"			
		}
	})
</script>

<style lang="scss" scoped>
	.layOut{
		.navbar{
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			z-index: 9;
			background: 
			linear-gradient(to bottom,transparent,#fff 400rpx),
			linear-gradient(to right,#beecd8 20%,#f4e2d8);
			.statusBar{
				
			}
			.titleBar{
				display: flex;
				padding: 0 30rpx;
				align-items: center;
				.title{
					color: $text-font-color-1;
					font-size: 44rpx;
					font-weight: 700;
				}
				.search{
					width: 220rpx;
					height: 56rpx;
					border-radius: 23rpx;
					background: rgba(255, 255, 255, 0.4);
					border: 2rpx solid #fff;
					margin-left: 30rpx;
					color: #999;
					font-size: 28rpx;
					display: flex;
					align-items: center;
					.icon{
						margin-left: 5rpx;
					}
					.text{
						padding-left: 10rpx;
					}
				}
			}
		}
		.fill{
			background: transparent;
		}
	}
</style>